package com.river.springbootdemo.thinkingjava.contructor;
import static java.lang.System.out;
public class Flower {
    int petalCount;
    String s = "initial value";

    Flower(int petals) {
        petalCount = petals;
        out.println("Constructor w/ int arg only ,petalCount = "+petalCount);
    }
    Flower(String ss) {
        out.println("Constructor w/ String arg only ,petalCount = "+ss);
        s=ss;
    }
    Flower(String s,int petals){
//        this(s);
        this(petals);
        this.s=s;
        out.println("String & int args");
    }
    Flower(){
        this("hi",47);
    }
    void printPetalCount(){
        out.println("petalCount = "+petalCount+"   s = " +s);
    }

    public static void main(String[] args) {
        Flower flower = new Flower();
        flower.printPetalCount();

    }
}
